Virtual machine migration is mainly sending data of memory of a virtual machine from a source physical host to a destination physical host. Virtual machine migration is a main part of virtual machine live migration. In virtual machine live migration, a virtual machine may be migrated from a source physical host to a destination physical host when the virtual machine is running, and continues to run on the destination physical host, thereby implementing service integration. Virtual machine live migration may be used to implement online maintenance, online upgrade, and load balancing on a server, and to provide a solution for disaster recovery.
In the prior art, on a Xen virtualization platform, virtual machine migration is performed by using a method of sending, in an iterative manner, data of memory of a virtual machine. During each iteration, dirty pages of the current iteration are selected in batches and these pages are mapped to a linear address space of a user process of a privileged virtual machine; after the mapping is complete, a hypercall is used to update a page table, so as to establish an association between the linear address space and a physical address; and after a mapped linear address is obtained, a remote direct memory access (RDMA) interface of user space is used to register the mapped physical address corresponding to the memory of the virtual machine with an RDMA network adapter, and subsequent data transmission is performed according to an RDMA communications protocol by calling another RDMA system. After data is sent successfully, the memory of the virtual machine is demapped from a user process space, and a registered physical memory is deregistered.
The inventor finds that the prior art has at least the following problems: On a virtualization platform, virtual machine migration requires mapping of memory of a virtual machine and updating, by using a hypercall, of a page table, which causes a high utilization rate and high time overhead on a central processing unit (CPU) in a physical host on which the virtual machine is located.